import axios, { type AxiosProxyConfig, type AxiosResponse } from "axios";
const instance = axios.create({
    baseURL:'http://localhost:9090',
    timeout: 2000
});
instance.interceptors.response.use((response) => {
    if (response.data.success) {
    console.log(response)
    return response;
    }else{
        return Promise.reject(response.data.data.message)
    }
},error =>{
    if(error.response.code == 2000){
        return error.response.data
    }
    // return Promise.reject(error)
}
)
export default instance;